/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
  lintOnSave: false,
  devServer: {
    port: 8081,
    open: true,
    proxy: {
      "/blogview": {
        // target: `http://112.74.46.54:7777`,
        target: `http://localhost:7777`,
        changeOrigin: true,
      },
    },
    disableHostCheck: true,
  },
  configureWebpack: {
    resolve: {
      extensions: [".js", ".vue", ".json"],
      alias: {
        "@": resolve("src"),
      },
    },
    output: {
      // 输出重构 打包编译后的js文件名称,添加时间戳.
      filename: `static/js/js[name].${new Date().getTime()}.js`,
      chunkFilename: `static/js/chunk.[id].${new Date().getTime()}.js`,
    },
  },

  css: {
    extract: {
      // 打包后css文件名称添加时间戳
      filename: `static/css/[name].${new Date().getTime()}.css`,
      chunkFilename: `static/css/chunk.[id].${new Date().getTime()}.css`,
    },
  },
};
